package cn.wolfcode.car.business.service;

import cn.wolfcode.car.business.domain.Contract;
import cn.wolfcode.car.business.query.ContractQuery;
import cn.wolfcode.car.common.base.page.TablePageInfo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

/**
 * 服务预约接口
 */
public interface IContractService {

    /**
     * 分页
     * @param qo
     * @return
     */
    TablePageInfo<Contract> query(ContractQuery qo);


    /**
     * 查单个
     * @param id
     * @return
     */
    Contract get(Long id);


    /**
     * 保存 发起合同审核
     * @param contract
     */
    void save(Contract contract,Long bpmnInfoId,Long director);

  
    /**
     * 更新
     * @param contract
     */
    void update(Contract contract);

    /**
     *  批量删除
     * @param ids
     */
    void deleteBatch(String ids);

    /**
     * 查询全部
     * @return
     */
    List<Contract> list();

    /**
     * 上传合同电子附件
     * @param file
     */
    String uploadFile(MultipartFile file) throws IOException;

    /**
     * 下载合同电子附件
     * @param id
     */
    String downloadContract(Long id, HttpServletRequest request) throws IOException;

    /**
     * 合同作废
     * @param id
     */
    void useless(Long id);


    /**
     * 合同审核通过
     * @param id
     */
    void approve(Long id);

    /**
     * 合同审核不通过
     * @param id
     */
    void unapprove(Long id);

    /**
     * 盖章
     * @param id
     */
    void affixSeal(Long id);

    /**
     * minio文件上传
     * @param file
     * @return
     */
    String uploadFileMinio(MultipartFile file) throws Exception;

    /**
     * 文件上传
     * @param file
     * @return
     */
    String uploadFile2(MultipartFile file) throws IOException;

    /**
     * 文件下载
     * @param id
     * @param response
     */
    void downloadContract2(Long id, HttpServletResponse response) throws IOException;
}
